/*
 * @Author: caofujun
 * @Date: 2020-09-17 15:05:10
 * @Description: 工具函数
 */
const fs = require('fs')
const path = require('path')
const pages = fs.readdirSync(path.join(__dirname, '../../src/views/business'))
const components = fs.readdirSync(path.join(__dirname, '../../src/components'))

/**
 * 验证组件存在
 * @param {*} comp
 */
const nameExist = comp => {
  return [...pages, ...components].indexOf(comp) > -1
}

module.exports = nameExist
